cmake_minimum_required(VERSION 3.22)

project(Bsp)
add_library(Bsp INTERFACE)

# Enable CMake support for ASM and C languages
enable_language(C ASM)

target_include_directories(Bsp INTERFACE
    Inc

)

target_sources(Bsp INTERFACE
    Src/bsp_system.c
    Src/bsp_gpio.c
    # Src/bsp_uart.c
    Src/bsp_uart_dma.c
    Src/bsp_i2c.c
    Src/bsp_spi.c
    Src/bsp_tim.c
    Src/bsp_flash.c
)

# Validate that STM32CubeMX code is compatible with C standard
if(CMAKE_C_STANDARD LESS 11)
    message(ERROR "Generated code requires C11 or higher")
endif()


